/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.spring.modelo.entidad;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Ricardo
 */
@Entity
@Table(name = "Programacion")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Programacion.findAll", query = "SELECT p FROM Programacion p"),
    @NamedQuery(name = "Programacion.findByCodProgramacion", query = "SELECT p FROM Programacion p WHERE p.codProgramacion = :codProgramacion")})
public class Programacion implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 10)
    @Column(name = "codProgramacion")
    private String codProgramacion;
    @JoinColumn(name = "codTurno", referencedColumnName = "codTurno")
    @ManyToOne
    private Turno codTurno;
    @JoinColumn(name = "codSemestre", referencedColumnName = "codSemestre")
    @ManyToOne
    private Semestre codSemestre;
    @JoinColumn(name = "codDocente", referencedColumnName = "codDocente")
    @ManyToOne
    private Docente codDocente;
    @JoinColumns({
        @JoinColumn(name = "codPlan", referencedColumnName = "codPlan"),
        @JoinColumn(name = "codCurso", referencedColumnName = "codCurso")})
    @ManyToOne
    private DetallePlan detallePlan;
    @JoinColumn(name = "codAula", referencedColumnName = "codAula")
    @ManyToOne
    private Aula codAula;

    public Programacion() {
    }

    public Programacion(String codProgramacion) {
        this.codProgramacion = codProgramacion;
    }

    public String getCodProgramacion() {
        return codProgramacion;
    }

    public void setCodProgramacion(String codProgramacion) {
        this.codProgramacion = codProgramacion;
    }

    public Turno getCodTurno() {
        return codTurno;
    }

    public void setCodTurno(Turno codTurno) {
        this.codTurno = codTurno;
    }

    public Semestre getCodSemestre() {
        return codSemestre;
    }

    public void setCodSemestre(Semestre codSemestre) {
        this.codSemestre = codSemestre;
    }

    public Docente getCodDocente() {
        return codDocente;
    }

    public void setCodDocente(Docente codDocente) {
        this.codDocente = codDocente;
    }

    public DetallePlan getDetallePlan() {
        return detallePlan;
    }

    public void setDetallePlan(DetallePlan detallePlan) {
        this.detallePlan = detallePlan;
    }

    public Aula getCodAula() {
        return codAula;
    }

    public void setCodAula(Aula codAula) {
        this.codAula = codAula;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codProgramacion != null ? codProgramacion.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Programacion)) {
            return false;
        }
        Programacion other = (Programacion) object;
        if ((this.codProgramacion == null && other.codProgramacion != null) || (this.codProgramacion != null && !this.codProgramacion.equals(other.codProgramacion))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.spring.modelo.entidad.Programacion[ codProgramacion=" + codProgramacion + " ]";
    }
    
}
